﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//Mark Rowe 
//From the IRDev Library Project.
namespace AutoDeploy.Common.Library
{
    public class CommandSet
    {
        public int Priority { get; set; }
        public string Part { get; set; }
        public string PartTrigger { get; set; }
        public string Command { get; set; }
        public string CommandTrigger { get; set; }
        public List<string> Values { get; set; }
        public string Description { get; set; }
        public string Success { get; set; }
        public string Error { get; set; }
        public CommandSet()
        {
            Priority = 0;
            Part = string.Empty;
            PartTrigger = string.Empty;
            Command = string.Empty;
            CommandTrigger = string.Empty;
            Values = new List<string>();
            Description = string.Empty;
            Success = string.Empty;
            Error = string.Empty;
        }
        public string ToString(bool isShortString)
        { 
            StringBuilder sb = new StringBuilder();
            sb.Append("Priority:"+ (isShortString ? Priority.ToString().Trim()+" |" : Priority.ToString().Trim() + "\n"));
            sb.Append("Part:"+(isShortString ? Part.ToString().Trim()+" |"  : Part.ToString().Trim() + "\n"));
            sb.Append("PartTrigger:" + (isShortString ? PartTrigger.ToString().Trim() + " |" : PartTrigger.ToString().Trim() + "\n"));
            sb.Append("Command:" + (isShortString ? Command.ToString().Trim() + " |" : Command.ToString().Trim() + "\n"));
            sb.Append("CommandTrigger:" + (isShortString ? CommandTrigger.ToString().Trim() + " |" : CommandTrigger.ToString().Trim() + "\n"));
            sb.Append("Values:" + (isShortString ? StringHelper.ListOfStringToString(Values, false) + " |" : StringHelper.ListOfStringToString(Values, true) + "\n"));
            sb.Append("Description:" + (isShortString ? Description.ToString().Trim() + " |" : Description.ToString().Trim() + "\n"));
            sb.Append("Success:" + (isShortString ? Description.ToString().Trim() + " |" : Description.ToString().Trim() + "\n"));
            return sb.ToString();
        }
    }
}
